home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mint110s / mint.h < prev    next >
C/C++ Source or Header  |  1994-02-11  |  5KB  |  234 lines

  1. /*
  2. Copyright 1990,1991,1992 Eric R. Smith.
  3. Copyright 1992,1993,1994 Atari Corporation.
  4. All rights reserved.
  5. */
  6.  
  7. #ifndef GENMAGIC
  8. /* use our own library: strongly recommended */
  9. #define OWN_LIB
  10. #endif
  11.  
  12. #ifdef OWN_LIB
  13. #include "ctype.h"
  14. #else
  15. #include <ctype.h>
  16. #include <string.h>
  17. #endif
  18. #include <osbind.h>
  19.  
  20. /* configuration options */
  21.  
  22. /* make real processor exceptions (bus error, etc.) raise a signal */
  23. #define EXCEPTION_SIGS
  24.  
  25. /* deliberately fill memory with junk when allocating: used for testing */
  26. #undef JUNK_MEM
  27.  
  28. #if 0
  29. /* other options best set in the makefile */
  30. #define MULTITOS    /* make a MultiTOS kernel */
  31. #define ONLY030        /* make a 68030 only version */
  32. #endif
  33.  
  34. #ifndef MULTITOS
  35. #define FASTTEXT    /* include the u:\dev\fasttext device */
  36. #endif
  37.  
  38. /* PATH_MAX is the maximum path allowed. The kernel uses this in lots of
  39.  * places, so there isn't much point in file systems allowing longer
  40.  * paths (they can restrict paths to being shorter if they want).
  41.  * (This is slowly changing, actually... fewer and fewer places use
  42.  *  PATH_MAX, and eventually we should get rid of it)
  43.  */
  44. #define PATH_MAX 128
  45.  
  46. /* maximum length of a string passed to ksprintf: this should be
  47.  * no more than PATH_MAX
  48.  */
  49. #define SPRINTF_MAX    PATH_MAX
  50.  
  51. /* NOTE: NAME_MAX is a "suggested" maximum name length only. Individual
  52.  * file systems may choose a longer or shorter NAME_MAX, so do _not_
  53.  * use this in the kernel for anything!
  54.  */
  55. #define NAME_MAX 14
  56.  
  57. /*
  58.  * configuration section: put compiler specific stuff here
  59.  */
  60.  
  61. #ifdef __GNUC__
  62. #define EXITING volatile    /* function never returns */
  63. #else
  64. #define EXITING
  65. #endif
  66.  
  67. #ifdef dLibs
  68. #define fullpath full_path
  69. #define SHORT_NAMES
  70. #endif
  71.  
  72. /* define to indicate unused variables */
  73. #ifdef __TURBOC__
  74. #define UNUSED(x)    (void)x
  75. #else
  76. #define UNUSED(x)
  77. #endif
  78.  
  79. /* define how to call functions with stack parameter passing */
  80. #ifdef __TURBOC__
  81. #define ARGS_ON_STACK cdecl
  82. #else
  83. #define ARGS_ON_STACK
  84. #endif
  85.  
  86. /* WARNING: Bconmap is defined incorrectly
  87.  * in the MiNT library osbind.h at patchlevel
  88.  * <= 19 and in early versions of the GNU C
  89.  * library. So use this binding for safety's sake.
  90.  */
  91.  
  92. #ifdef __GNUC__
  93. #undef Bconmap
  94. #define Bconmap(dev) (long)trap_14_ww(0x2c, dev)
  95. #endif
  96.  
  97. #ifndef __TURBOC__
  98. #ifndef Bconmap
  99. extern long xbios();
  100. #define Bconmap(dev) xbios(0x2c, dev)
  101. #endif
  102. #endif
  103.  
  104. /* Binding for Flock */
  105. #ifndef __TURBOC__
  106. #ifndef Flock
  107. extern long gemdos();
  108. /* this may need to be adjusted for your compiler/library */
  109. #define Flock(handle, mode, start, len) gemdos(0x5c, handle, mode, start, len)
  110. #endif
  111. #endif
  112.  
  113. #ifdef OWN_LIB
  114. /* Sigh. Some compilers are too clever for their
  115.  * own good; gcc 2.1 now makes strcpy() and some
  116.  * other string functions built-in; the built-in
  117.  * definitions disagree with ours. So we redefine
  118.  * them here. This also helps us to avoid conflict
  119.  * with any library stuff, in the event that we
  120.  * have to link in a library.
  121.  */
  122.  
  123. #define strlen    MS_len
  124. #define strcpy    MS_cpy
  125. #define strncpy    MS_ncpy
  126. #define strcat    MS_cat
  127. #define strncat    MS_ncat
  128. #define strcmp    MS_cmp
  129. #define strncmp    MS_ncmp
  130. #define strnicmp    MS_nicmp
  131. #define stricmp    MS_icmp
  132. #define strlwr    MS_lwr
  133. #define strupr    MS_upr
  134. #define sleep    M_sleep
  135. #endif
  136.  
  137. #ifdef SHORT_NAMES
  138. #define dispose_fileptr ds_fileptr
  139. #define dispose_region ds_region
  140. #define dispose_proc ds_proc
  141. #endif
  142.  
  143. /* prototype macro thingy */
  144. #ifdef __STDC__
  145. #define P_(x) x
  146. #else
  147. #define P_(x) ()
  148. #define const
  149. #define volatile
  150. #endif
  151.  
  152. #ifndef GENMAGIC
  153. #include "assert.h"
  154. #endif
  155. #include "atarierr.h"
  156. #include "basepage.h"
  157. #include "types.h"
  158. #include "signal.h"
  159. #include "mem.h"
  160. #include "proc.h"
  161.  
  162. #ifndef GENMAGIC
  163. #include "proto.h"
  164. #include "sproto.h"
  165. #endif
  166.  
  167. #ifndef NULL
  168. #define NULL ((void *)0)
  169. #endif
  170.  
  171. #ifndef TRUE
  172. #define TRUE 1
  173. #define FALSE 0
  174. #endif
  175.  
  176. /* is debugging info included? */
  177. #ifndef MULTITOS
  178. #define DEBUG_INFO
  179. #endif
  180.  
  181. #ifndef DEBUG_INFO
  182. #define TRACELOW(x)
  183. #define TRACE(x)
  184. #define DEBUG(x)
  185. #else
  186. #define TRACELOW(x) Tracelow x
  187. #define TRACE(x) Trace x
  188. #define DEBUG(x) Debug x
  189. #endif
  190.  
  191. #define check_addr(x) 0
  192. #define yield() sleep(READY_Q, 0L)
  193.  
  194. #define CTRL(x) ((x) & 0x1f)
  195.  
  196. #ifndef GENMAGIC
  197.  
  198. extern short timestamp, datestamp;    /* in timeout.c */
  199.  
  200. typedef struct kbdvbase {
  201.     long midivec;
  202.     long vkbderr;
  203.     long vmiderr;
  204.     long statvec;
  205.     long mousevec;
  206.     long clockvec;
  207.     long joyvec;
  208.     long midisys;
  209.     long ikbdsys;
  210. } KBDVEC;
  211.  
  212. extern KBDVEC *syskey;
  213.  
  214. #define ST    0
  215. #define STE    0x00010000L
  216. #define MEGASTE 0x00010010L
  217. #define TT    0x00020000L
  218. #define FALCON    0x00030000L
  219.  
  220. extern long mch;
  221.  
  222. extern int has_bconmap;    /* set in main() */
  223. extern int curbconmap;  /* see xbios.c */
  224.  
  225. #define MAXLANG 6    /* languages supported */
  226. extern int gl_lang;    /* set in main.c */
  227.  
  228. /*
  229.  * load some inline functions, perhaps
  230.  */
  231. #include "inline.h"
  232.  
  233. #endif /* GENMAGIC */
  234.